import { useNavigate, Navigate } from "react-router-dom";

function RouterAuth(props){
    // 通过token来判断是否登录
    const token = localStorage.getItem('admin-token')
    if (!token){
        return <Navigate to='/login' replace />
    }
    return props.children

}

export default RouterAuth